package com.gegewa.topic.dynamicdatasource.controller;

import com.gegewa.topic.dynamicdatasource.dao.TeacherDao;
import com.gegewa.topic.dynamicdatasource.entity.Teacher;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

@Controller
public class TeacherController {

    @Resource
    private TeacherDao teacherDao;

    @RequestMapping("/getTeacherList")
    @ResponseBody
    public List<Teacher> getTeacherList() {
        List<Teacher> studentList = teacherDao.selectList(Collections.emptyMap());
        return studentList;
    }

}
